package com.ganbo.rabbitmq.producer.controller;


import com.ganbo.rabbitmq.producer.service.ProducerMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProducerMessageController {

    @Autowired
    ProducerMessageService producerMessageService;


    @GetMapping("/send")
    public String send(String msg) {
        producerMessageService.send(msg);
        return "success";
    }


    /**
     * 消费者消费成功以后回到生产者
     *
     * @param messageId
     * @return
     */
    @GetMapping("/callBack")
    public String callBack(String messageId) {
        producerMessageService.callBack(messageId);
        return "success";
    }

}
